//
//  BodiTextField.m
//  UI02_HomeWork_01
//
//  Created by Bodi on 16/6/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BodiTextField.h"

@implementation BodiTextField

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame withPlace:(NSString *)placehodel{
    self = [super initWithFrame:frame];
    if (self) {
        self.placeholder = placehodel;
        [self setPropertys];
        [self udge];
    }

    return self;

}
-(void)setPropertys{

    self.font = [UIFont systemFontOfSize:18.0f];
    self.borderStyle = UITextBorderStyleRoundedRect;
    self.clearButtonMode = UITextFieldViewModeAlways;
    
    self.returnKeyType = UIReturnKeyDone;
    
    
    
    

}
-(void)udge{

if ([self.placeholder isEqualToString:@"请输入密码"]) {
        self.secureTextEntry = YES;

    }else if ([self.placeholder isEqualToString:@"再次输入密码"]){
    
    self.secureTextEntry = YES;
    }else{
    self.secureTextEntry = NO;
    
    }
    if ([self.placeholder isEqualToString:@"请输入联系方式"]) {
        self.keyboardType = UIKeyboardTypeNumberPad;
    }else{
    self.keyboardType = UIKeyboardTypeAlphabet;
    
    }
    

}

@end
